#include <iostream>
#include <vector>

using namespace std;

int main()
{
    long long V = 0;
    int n = 0;
    cin >> n >> V;

    vector<long long> arr(n);
    int count = 0;
    long long sum = 0;
    for (int i = 0; i < n; ++i)
    {
        cin >> arr[i];
    }
    for (int i = 0; i < n; ++i)
    {
        if (sum + arr[i] <= V)
            sum += arr[i];
        else
        {
            ++count;
            --i;
            sum = 0;
        }
    }
    cout << ++count << endl;
    return 0;
}